<#setting number_format=",###.###">
<#setting classic_compatible="true">
<style id="printStyle">
#pageHead,#printHead,#tableArea,#remark,#printFooter,#contractContent,#pageFooter{
    font-family: Times New Roman,DFPBiaoKaiShu-B5,KaiTi_GB2312;
    font-size: 12px;
    line-height: 22px;
}
td,tr,talbe {
    margin: 0;
    padding: 0;
}

div{
    word-break:break-strict; 
}

table {
    border-spacing: 0;
    border-spacing: 0 !important;
    *border-collapse: expression('separate', cellSpacing =   '0px');
    border-spacing: expression(this.cellSpacing = 0);
    table-layout:fixed; 
    word-break:break-strict; 
}

td,th {
    display: table-cell;
    vertical-align: inherit;
}

table th,table td {
    text-align: left;
    line-height: 25px;
}

.printTable {
    width: 100%;
    margin: 0;
    padding: 0;
}

.printTable td {
    line-height: 25px;
    word-wrap:break-word;
    word-break:break-all;
}

.printTable tr {
    width: 100%;
}

.printLine td{
    text-align: center;
    border: 1px solid gray;
    border-collapse:collapse;
}
.remark{
    line-height: 20px;
    word-wrap:break-word;
    word-break:break-all;
    text-align: left;
}
.lineTitle{
    display: table-cell;
    vertical-align: top;
}
.quotationtext{
    margin: 2px;
}
</style>
<div id="pageHead">
    <div style="height: 100px;width: 740px;">
        <div style="width: 180px;float: left;">
            <img alt="" src="${staticDomain}images/system/logo/${entity.company.logo}" width="180" height="84"/>
        </div>
        <div style="line-height: 30px; font-size:${fontSize-0.2}em;font-weight:bolder; text-align: center;width:620px;float: left;margin-left:100px;margin-top: -80px;">${entity.company.name}</div>
        <div style="line-height: 30px; text-align: center;font-size:${fontSize-0.5}em;width:400px;float: right;margin: -30px 115px 0;">Quotation</div>
    </div>  
</div>
<div id="printHead">
    <div style="float: left;width: 700px;">
        <table border="0" cellspacing="0" cellpadding="0" width="98%" style="margin-top:15px;">
            <tbody> 
                <tr>
                    <td width="5%"></td>
                    <td width="45%"></td>
                    <td width="5%">No</td>
                    <td width="45%">:${entity.quotationNo}</td>
                </tr>
                <tr>
                    <td>To</td>
                    <td>:${entity.customer.name}</td>
                    <td>From</td>
                    <td>:${entity.company.name}</td>
                </tr>
                <tr>
                     <td>Attn</td>
                     <td>:${entity.customer.linkPerson}</td>
                     <td>Attn</td>
                     <td>:${entity.company.linkPerson}</td>
                </tr>
                <tr>
                    <td>Tel</td>
                    <td>:${entity.customer.linkTelephone}</td>
                    <td>Date</td>
                    <td>:${entity.generateDate?string("yyyy-MM-dd")}</td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
<div id="tableArea">
    <div style="float: left;width: 700px;">
        <table class="printTable" style="margin-top: 20px;">
            <thead>
                <tr>
                    <td class="lineTitle" width="15%">Title:</td>
                    <td colspan="7">${entity.title}</td>
                </tr>
                <tr>
                    <td class="lineTitle">Size:</td>
                    <td colspan="7"><pre class="quotationtext">${entity.specification}</pre></td>
                </tr>
                <tr>
                    <td class="lineTitle">Origination:</td>
                    <td colspan="7"><pre class="quotationtext">${entity.origination}</pre></td>
                </tr>
                <tr>
                    <td class="lineTitle">Packing:</td>
                    <td colspan="7"><pre class="quotationtext">${entity.packing}</pre></td>
                </tr>
                <tr>
                    <td class="lineTitle">Delivery's Date:</td>
                    <td colspan="7"><pre class="quotationtext"><#if entity.deliveryDate??>${entity.deliveryDate?string("yyyy-MM-dd")}</#if>&#160;</pre></td>
                </tr>
                <tr class="printLine">
                    <td width="10%">No.</td>
                    <td width="10%">Material</td>
                    <td width="10%">Spec.</td>
                    <td width="25%">Quantity per title</td>
                    <td width="20%">Total Quantity</td>
                    <td width="15%">Unit Cost</td>
                    <td width="10%">Run On</td>
                    <td width="20%">Amount(${currency})</td>
                </tr>
            </thead>
            <tbody>
                <#list orderItems as item>
                <tr class="printLine">
                    <td style="text-align: center;">&#160;${item.title }</td>
                    <td style="text-align: center;">&#160;${item.material}</td>
                    <td style="text-align: center;">&#160;${item.specification}</td>
                    <td style="text-align: center;">&#160;${item.quantity }</td>
                    <td style="text-align: center;">&#160;${item.title * item.quantity }</td>
                    <td style="text-align: center;">&#160;${item.unitPrice }</td>
                    <td style="text-align: center;">&#160;${item.discountPrice}</td>
                    <td style="text-align: center;">&#160;${item.title * item.quantity * item.unitPrice}</td>
                </tr>
                </#list>
                <tr class="printLine">
                    <td colspan="8" style="text-align: left;">Extra Cost</td>
                </tr>
                <tr class="printLine">
                    <td style="text-align: center;">No</td>
                    <td colspan="6" style="text-align: center;">Description</td>
                    <td style="text-align: center;">Cost(${currency})</td>
                </tr>
                <#list chargeItems1 as item>
                <tr class="printLine">
                    <td style="text-align: center;">&#160;${item_index + 1}</td>
                    <td style="text-align: left;" colspan="6">&#160;${item.description }</td>
                    <td style="text-align: center;">&#160;${item.total}</td>
                </tr>
                </#list>
                <tr class="printLine">
                    <td colspan="8" style="text-align: left;">Saving cost</td>
                </tr>
                <tr class="printLine">
                    <td style="text-align: center;">No</td>
                    <td colspan="6" style="text-align: center;">Description</td>
                    <td style="text-align: center;">Cost(${currency})</td>
                </tr>
                <#list chargeItems2 as item>
                <tr class="printLine">
                    <td style="text-align: center;">&#160;${item_index + 1}</td>
                    <td style="text-align: left;" colspan="6">&#160;${item.description }</td>
                    <td style="text-align: center;">&#160;${item.total }</td>
                </tr>
                </#list>
                <tr>
                    <td class="lineTitle">Payment:</td>
                    <td colspan="7"><pre class="quotationtext">${entity.payment}</pre></td>
                </tr>
                <tr>
                    <td class="lineTitle">Validity:</td>
                    <td colspan="7">Prices are valid till ${entity.expiredDate?string("yyyy-MM-dd")}. The validity period may not be extended in case of any revision made to this quotation.</td>
                </tr>
                <#if pictures??>
                <tr>
                    <td colspan="8">
                      <table>
	                        <tr>
	                            <#list pictures as item>
	                                <td style="text-align: center;width: 150px;">
	                                    <img src="${dynamicDomain}/download/${item.fileId?string('###')}${item.fileSuffix}" width="140">
	                                </td>
	                           </#list>
	                        </tr>
	                        <tr>
	                           <#list pictures as item>
                                    <td style="text-align: center;">
	                                   ${item.remark!}
	                                </td>
	                           </#list>
	                        </tr>
                      </table>  
                    </td>
                </tr>
                </#if>
             </tbody>
          </table>
     </div>
 </div>